//所有接口的集合
import { get, post } from "./index";

/* ===============1,菜单管理===== */
//菜单的添加
export const menuAdd = (data) => post("/menuadd", data);
//菜单列表
export const menuList = (data) => get("/menulist", data);
//菜单的删除
export const menuDelete = (data) => post("/menudelete", data);
//菜单一条数据
export const menuInfo = (data) => get("/menuinfo", data);
//菜单的编辑
export const menuEdit = (data) => post("/menuedit", data);

/* ===============2,角色管理===================== */
//角色的添加
export const roleAdd = (data) => post("/roleadd", data);
//角色列表
export const roleList = () => get("/rolelist");
//角色的删除
export const roleDelete = (data) => post("/roledelete", data);
//角色获取一条数据
export const roleInfo = (data) => get("/roleinfo", data);
//角色的编辑
export const roleEdit = (data) => post("/roleedit", data);

/* ===============3,管理员管理===================== */
export const userlist = params=>get('/userlist',params)
//管理员的添加
export const useradd =data=>post('/useradd',data)
//管理员的删除
export const userdelete =data=>post('/userdelete',data)
//管理员的编辑
export const useredit =data=>post('/useredit',data)
//管理员获取（一条）
export const userinfo =params=>get('/userinfo',params)
//管理员总数查询
export const usercount =()=>get('/usercount')

/* ==============4,=登录===================== */

//管理员的登录
export const userlogin =data=>post('/userlogin',data)

/* =============5,商品分类管理=============== */
// 添加
export const cateAdd = data=>post('/cateadd',data,true)
// 封装一个分类列表的接口
export const cateList = data=>get('/catelist',data)
// 封装一个分类删除的接口
export const cateDel = data=>post('/catedelete',data)
// 封装一个分类列表的接口 一条数据
export const cateInfo = data=>get('/cateinfo',data)
// 分类编辑
export const cateEdit = data=>post('/cateedit',data,true)

// =============6,商品规格管理===============
//商品规格属性列表
export const specslist = params=>get('/specslist',params)
//商品规格属性的添加
export const specsadd =data=>post('/specsadd',data)
//商品规格属性的删除
export const specsdelete =data=>post('/specsdelete',data)
//商品规格属性的编辑
export const specsedit =data=>post('/specsedit',data)
//商品规格属性获取（一条）
export const specsinfo =params=>get('/specsinfo',params)
//商品规格属性总数查询
export const specscount =()=>get('/specscount')
/* ==============7,商品管理接口*/
//商品列表
export const goodslist = params=>get('/goodslist',params)
//商品的添加
export const goodsadd =data=>post('/goodsadd',data,true)
//商品的删除
export const goodsdelete =data=>post('/goodsdelete',data)
//商品的编辑
export const goodsedit =data=>post('/goodsedit',data,true)
//商品获取（一条）
export const goodsinfo =params=>get('/goodsinfo',params)
//商品总数查询
export const goodscount =()=>get('/goodscount')
// =============8,会员===============
//会员列表 必填项
export const memberList = () => get("/memberlist");
//会员获取一条数据
export const memberInfo = (data) => get("/memberinfo", data);
//会员的编辑
export const memberEdit = (data) => post("/memberedit", data);
//=============9 轮播图
//轮播图列表 bannerlist
export const bannerList =()=>get('/bannerlist')
//轮播图的添加 /api/banneradd
export const bannerAdd =data=>post('/banneradd',data,true)
//轮播图的删除 /api/bannerdelete
export const bannerDelete =data=>post('/bannerdelete',data)
//轮播图的编辑 /api/banneredit
export const bannerEdit =data=>post('/banneredit',data,true)
//轮播图获取 /api/bannerinfo
export const bannerInfo =params=>get('/bannerinfo',params)

//==========10
// 限时秒杀添加
export const seckAdd = data => post('/seckadd', data)
// 限时秒杀列表
export const seckList = () => get('/secklist')
// 限时秒杀列表的获取
export const seckInfo = data => get('/seckinfo', data)
// 限时秒杀修改
export const seckEdit = data => post('/seckedit', data)
// 限时秒杀删除
export const seckDel = data => post('/seckdelete', data)



